#define  _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    string removeDuplicates(string s) {
        string ret;
        for (auto ch : s)
            if (ret.empty() || ret.back() != ch)ret += ch;
            else ret.pop_back();
        return ret;
    }
};